import 'json_convert.dart';

class LfBaseEntity<T> {
  LfBaseEntity(this.code, this.message, this.data);

  LfBaseEntity.fromJson(Map<String, dynamic> json) {
    code = json['code'] as int;
    message = json['message'] as String;
    if (json.containsKey('data')) {
      var jsonObj = json['data'];
      if (jsonObj.toString().isNotEmpty) {
        // data = _generateOBJ<T>(jsonObj);
        data = FFConvert.convert<T>(jsonObj);
      }
    }
  }

  int code = 0;
  String message = "";
  T? data;
}
